//
//  topCollectionViewCell.m
//  movie
//
//  Created by 李丹阳 on 15/7/21.
//  Copyright (c) 2015年 李丹阳. All rights reserved.
//

#import "topCollectionViewCell.h"

@implementation topCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
    self.starView = [[starView alloc]initWithFrame:CGRectMake(0, 135, 90, 16)];

}

- (void)setModal:(topModal *)modal{
    _modal = modal;
    self.starView.average = modal.average;
    [self setNeedsLayout];
}

- (void)layoutSubviews{
    _titleLabel.text = _modal.title;
    _averageLabel.text = [NSString stringWithFormat:@"%.1f",_modal.average ];
    NSString *imageStr = [_modal.image objectForKey:@"large"];
    [_iconImage sd_setImageWithURL:[NSURL URLWithString:imageStr]];
    
    
    [self.contentView addSubview:self.starView];
    
    
    //    [self addStarLabel];
    
}

@end
